﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Collections.Generic;
using System.Reflection;

public partial class Controls_SXMXControl : System.Web.UI.UserControl
{
    public string SXID
    {
        get { return DropDownList1.SelectedValue; }
    }
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    public void Bind(List<Model.SHUXING> l)
    {
        DropDownList1.DataSource = l;
        DropDownList1.DataTextField = "SX_MC";
        DropDownList1.DataValueField = "SX_ID";
        DropDownList1.DataBind();
    }
    public void Button1_Click(object sender, EventArgs e)
    {
        Add();
    }
    public void Add()
    {
        //用反射方法动态调用父页面的方法

        System.Web.UI.Page p = this.Page;
        Type pageType = p.GetType();
        MethodInfo mi = pageType.GetMethod("AddProperty");
        mi.Invoke(p, null);
    }
}
